package com.lyf.design.practice.theory.behavior.chain;

/**
 * @author LYF
 * @date 2022/6/22
 */
public class HrHandler extends Handler{
    public HrHandler() {
    }

    public HrHandler(String name, Handler nextHandler) {
        super(name, nextHandler);
    }

    @Override
    public void setNextHandler(Handler nextHandler) {
        super.setNextHandler(nextHandler);
    }

    @Override
    void handle(Integer money) {
        if(money>500){
            System.out.println(name+" has no power,need find boss");
            nextHandler.handle(money);
        }

        else
            System.out.println(name+"(hr) has handled");
    }
}
